<template>
<div><h1>学生管理</h1>
<AddStudent ></AddStudent>
<!-- <FindStudent></FindStudent> -->
<UpdateStudent ></UpdateStudent>
<!-- @setStudent="setStudent" :student="student" -->
<ListStudent></ListStudent><br>
<!--@setDialogVisible="setDialogVisible" @setStudent="setStudent" -->
<PageStudent></PageStudent>

</div>
  
</template>

<script>
import PageStudent from '../components/PageStudent'
import ListStudent from '../components/ListStudent'
import AddStudent  from '../components/AddStudent'
import FindStudent from '../components/FindStudent'
import UpdateStudent from '../components/UpdateStudent'

import {findAll} from '../service';
import {mapMutations,mapActions} from 'vuex'
export default {
    data(){
        return{
            // students:[],
            // pagenation:{},
            // dialogVisible:false,
            // obj:"",
            // info:""
            }   
    },
    //生命周期，在运行之后调用show方法
    created(){
       this.setStudents();
    },
    methods:{
    async show(pageParm){
      // if(pageParm && pageParm.info){
      // this.obj=pageParm.obj;
      // this.info=pageParm.info; 
      // }else{
      //   if(pageParm){
      //   pageParm.obj=this.obj;
      //   pageParm.info=this.info;
      //   }
      // }
      // this.setStudents(pageParm);
    //查询所有学生数据的方法
    // let response=await findAll(pageParm);
    // this.pagenation=response;
    // // console.log(response);
    // this.students=response.list;
    },
    
    // setDialogVisible(dialogVisible){
    //   this.dialogVisible=dialogVisible;
    // },
    // setStudent(student){
    //  this.student=student;
    // }
     ...mapActions("student",["setStudents"])

    },
    //注册
    components:{
    PageStudent,ListStudent,AddStudent,UpdateStudent,
    // FindStudent
  }
}
</script>

<style>

</style>
